import React from "react";
import classNames from "classnames";
import {Modal as Alert,Button,NavBar,Toast} from '@/ui'
import "./index.less";
export default function Home(props: any) {
  const { prefixCls = "m-react-page-toast" } = props;
  const className = classNames({
    [prefixCls]: true,
  });
  const alertAction = () => {
    Alert({
      title: "确定删除该地址吗？",
      message: "有这个功能呢",
      onConfirm: () => {
        console.log("onConfirm");
      },
      onCancel: () => {
        console.log("onCancel");
      },
    });
  };
  const toastAction = () => {
    Toast.info("厉害啊，这个也会", 5);
  };
  return (
    <>
      <NavBar title="Toast" />
      <div className={className}>
        <div className="modal" onClick={alertAction}>
          <Button size="m">点我试试</Button>
        </div>
        <div className="modal" onClick={toastAction}>
          <Button size="s">叼我试试</Button>
        </div>
      </div>
    </>
  );
}
